const progressBar = require('progress')
const bar = new progressBar(':bar', { total: 10 })
let timer = setInterval(() => {
    bar.tick()
    if (bar.complete) {
        clearInterval(timer)
    }
}, 100)
const doSomethingAsync = () => {
    return new Promise(resolve => {
        resolve('做些事情')
    })
}

const doSomething = async () => {
    console.log(await doSomethingAsync())
}

console.log('之前')
doSomething()
console.log('之后')